package com.tanhua.dubbo.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.itheima.model.pojo.Options;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface OptionsMapper extends BaseMapper<Options> {

    @Select("select * from tb_options where questions_id = #{id}")
    List<Options> findList(Long id);

    @Select("insert into tb_options values(0, #{option}, #{questionsId}, #{score}, #{created}, #{updated})")
    void insertOptions(Options options);

    @Select("select * from tb_options where id = #{optionId} and questions_id = #{questionsId}")
    Options findByIdAndQuestionsId(@Param("optionId") String optionId, @Param("questionsId") String questionsId);
}
